//
// Created by xumy on 2021/8/8.
// 函数模板实例
//

#include "iostream"
#include "string"

using namespace std;

template<typename T>
T const& Max(T const& a, T const& b)
{
    return a < b ? b:a;
}

int main()
{
    int i = 2, j = 4;
    cout << "Max(i, j)" << Max(i, j) << endl;

    double f1 = 4.232, f2 = 5.151;
    cout << "Max(f1, f2) " << Max(f1, f2) << endl;

    string s1 = "hello", s2 = "world";
    cout << "Max(s1, s2) " << Max(s1, s2) << endl;

    return 0;
}